package LocalStorage

import (
	"KumquatDrivesServices/StorageEngine"
	"KumquatDrivesServices/utils"
	"github.com/sirupsen/logrus"
	"os"
	"path/filepath"
)

func (Le LocalEngine) GetCoverImage(UserEmail string, fileName string) ([]byte, error) {
	filePath := filepath.Join(Le.getCoverFilePath(UserEmail), fileName)
	if bol := utils.PathExists(filePath); !bol {
		logrus.Errorf("file %s not exists", filePath)
		return nil, StorageEngine.ErrFileNotExistErr
	}
	return os.ReadFile(filePath)
}
